package com.github.niefy.modules.third.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.github.niefy.common.utils.Json;
import lombok.Builder;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 第三方系统基本信息
 */
@Data
@Builder
@TableName("third_sys_info")
public class ThirdSysInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 系统区别ID
     */
    @NotBlank
    @TableId(type = IdType.INPUT)
    private String sysName;
    /**
     * 系统对应公众号或小程序的appid
     */
    @TableField(value = "wx_appid", insertStrategy = FieldStrategy.NOT_EMPTY,
            updateStrategy = FieldStrategy.NOT_EMPTY)
    @NotBlank
    private String wxAppid;
    /**
     * 系统openapi注册的appid
     */
    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private String openAppid;
    /**
     * 域名
     */
    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private String domain;
    /**
     * 他方请求我方secret
     */
    private String serverSecret;
    /**
     * 本系统在三方系统注册的appid
     */
    private String clientAppid;
    /**
     * 我方请求他方secret
     */
    private String clientSecret;


    @Override
    public String toString() {
        return Json.toJsonString(this);
    }
}
